# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Luis Aranguren <pizzaman@hotmail.com>

pkgname=mdk4
pkgver=4.2
pkgrel=1
pkgdesc="A tool to exploit common IEEE 802.11 protocol weaknesses"
url="https://github.com/aircrack-ng/mdk4"
arch=('loong64' 'x86_64')
license=('GPL')
depends=('libpcap')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
b2sums=('a31bd39a7e92cb64872d474a17cd32ab7e90109bef119f7343feb91b5e49cbc42b2f80766b539f6e60adb158c3028f2d85738e7f4583edbe8f05ff723414d910')

build() {
  cd "$pkgname-$pkgver"
  make
}
package() {
  cd "$pkgname-$pkgver"

  # binary
  install -vDm755 -t "$pkgdir/usr/bin" src/mdk4

  # man page
  install -vDm644 man/mdk4.2 "$pkgdir/usr/share/man/man8/mdk4.8"

  # documentation
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
  cp -vr useful_files "$pkgdir/usr/share/doc/$pkgname"
}
